<template>
  <view class="">
    <image class="w-[200rpx] h-[200rpx]" src="/static/img/logo.png"></image>
    <view >
      <text class=" italic text-[#ff6600] fontSize32">123132</text>
    </view>
    <view>{{counter.count}}</view>
    <view class="btn btn-blue">按钮</view>
    
    <up-select v-model:current="cateId" label="分类"
                :options="cateList" @select="selectItem"></up-select>
                
    <!-- <up-keyboard ref="uKeyboard" mode="car" :show="show"></up-keyboard> -->
    <up-calendar :show="show"></up-calendar>
    <up-button @click="show = true">打开</up-button>
  </view>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { useCounterStore } from '@/store/counter.js'
import user from '@/api/user.js'
const counter = useCounterStore()
setTimeout(()=>{
  counter.increment();
},4000)

// // 接口请求
// onMounted( () => {
  
// })



let id = ''
const init1 = async () => {
  let res = await user.comments({
    postId: 1
  })
  console.log(res);
  id = res[3].id
}
const init2 = async () => {
  let res = await user.login({
    id
  })
  console.log(res);
}

await init1()
init2()
// 响应式数据  
const cateId = ref('')
const cateList = ref([
    {
        id: '1',
        name: '分类1'
    },
    {
        id: '2',
        name: '分类2'
    },
    {
        id: '3',
        name: '分类4'
    },
])
  
// 方法  
const selectItem = (item) => {  
  console.log(item);  
}; 

const show = ref(false);
</script>

<style lang="scss" scoped>
</style>
